import { RespInfo, RespStatusCode } from "../types/common.type";
// import uuid from 'node-uuid';
var uuid = require('node-uuid');


/**
 * 服务返回统一处理器
 * @param data 
 * @param code 
 * @param message 
 * @returns 
 */
export function RespMethod(data: Object = {}, code: RespStatusCode = RespStatusCode.Success, message: string = 'ok'): RespInfo {
  return { code, message, data }
}

/** 生成 uid */
export function getUid(): string {
  return uuid.v4().replace(/-/g, ''); // 去除横线-
}